.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  text-align: center;
  padding: 1.2rem 0.8rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.8rem;
  margin: 0 0 0.3rem 0;
  font-weight: bold;
}

.header p {
  font-size: 0.95rem;
  margin: 0;
  opacity: 0.9;
}

.main {
  flex: 1;
  padding: 0 1rem;
}

.container {
  max-width: 1800px; /* 从1200px增加到1800px，即1.5倍 */
  margin: 0 auto;
}

.examples {
  margin-bottom: 2rem;
  text-align: center;
}

.examples h3 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.example-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.example-btn {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  color: #495057;
}

.example-btn:hover {
  background: #e9ecef;
  border-color: #667eea;
  color: #667eea;
}

/* 主工作区域 - 左右布局 */
.main-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem; /* 从2rem增加到3rem，增加间距 */
  margin-top: 1rem;
  height: 600px; /* 固定高度 */
}

.input-section, .output-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem; /* 从1.5rem增加到2rem，增加内边距 */
  height: 100%; /* 使用固定高度 */
  display: flex;
  flex-direction: column;
  min-height: 0; /* 防止flex子元素溢出 */
  overflow: hidden; /* 防止内容溢出影响布局 */
}

.output-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1rem;
  flex-shrink: 0; /* 防止被压缩 */
}

.output-header h3 {
  color: #333;
  margin: 0;
  font-size: 1.3rem;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
  flex-shrink: 0; /* 防止被压缩 */
}

.input-header h3 {
  color: #333;
  margin: 0;
  font-size: 1.3rem;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0; /* 防止被压缩 */
}

.language-select {
  padding: 0.5rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  cursor: pointer;
  min-width: 200px;
}

.language-select:focus {
  outline: none;
  border-color: #667eea;
}

.curl-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: none; /* 禁止手动调整大小 */
  margin-bottom: 1rem;
  flex: 1; /* 自适应剩余空间 */
  min-height: 0; /* 防止flex子元素溢出 */
  overflow-y: auto; /* 内容超出时显示滚动条 */
}

.curl-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.curl-input::placeholder {
  color: #6c757d;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0; /* 防止被压缩 */
}

.convert-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0; /* 防止被压缩 */
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.convert-btn:active {
  transform: translateY(0);
}

.auto-convert-hint {
  color: #6c757d;
  font-size: 0.9rem;
  font-style: italic;
}

.copy-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #218838;
  transform: translateY(-1px);
}

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin-bottom: 1rem;
  flex-shrink: 0; /* 防止被压缩 */
}

.code-output {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e9ecef;
  flex: 1; /* 自适应剩余空间 */
  min-height: 0; /* 防止flex子元素溢出 */
  display: flex;
  flex-direction: column;
}

.code-output pre {
  height: 100% !important;
  margin: 0 !important;
  overflow-y: auto !important; /* 确保滚动条显示 */
  flex: 1 !important;
}

.placeholder {
  text-align: center;
  color: #6c757d;
  padding: 3rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #dee2e6;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1; /* 自适应剩余空间 */
  min-height: 0; /* 防止flex子元素溢出 */
}

.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
  margin-top: 2rem;
}

.footer a {
  color: #667eea;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  .header {
    padding: 1rem 0.6rem;
    margin-bottom: 1.2rem;
  }
  
  .main-workspace {
    grid-template-columns: 1fr;
    gap: 1rem;
    height: auto; /* 移动端不固定高度 */
  }
  
  .input-header, .output-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .input-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .convert-btn {
    width: 100%;
  }
  
  .auto-convert-hint {
    text-align: center;
    margin-top: 0.5rem;
  }
  
  .language-select {
    min-width: auto;
    width: 100%;
  }
  
  .example-buttons {
    flex-direction: column;
  }
  
  .example-btn {
    width: 100%;
  }
  
  .input-section, .output-section {
    padding: 1rem;
    height: auto; /* 移动端不固定高度 */
  }
  
  .curl-input {
    height: 200px; /* 移动端较小高度 */
  }
  
  .code-output, .placeholder {
    height: 250px; /* 移动端较小高度 */
  }
  
  .main {
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0.8rem 0.4rem;
  }
  
  .header h1 {
    font-size: 1.3rem;
  }
  
  .header p {
    font-size: 0.85rem;
  }
  
  .curl-input {
    font-size: 12px;
    height: 150px; /* 小屏幕更小高度 */
  }
  
  .input-section, .output-section {
    height: auto; /* 小屏幕不固定高度 */
  }
  
  .placeholder {
    height: 200px; /* 小屏幕较小高度 */
    padding: 2rem 1rem;
  }
  
  .code-output {
    height: 200px; /* 小屏幕较小高度 */
  }
}
